define(['common/js/service/boss-common-service-0.1'],
function() {
		
//项目相关常用下拉框
	serviceModule.factory("CartSaleCommonService",function($window, $http, $q,CommonRestService){
		return {
            //SaleCustomerService
            //-------------------------------------【会员开始】--------------------------------------
			findCustomer : function(requestParams){
				 return CommonRestService.query("/common/crm/customer/findCustomer",requestParams);
			},
			saveCustomer : function(requestParams){
				 return CommonRestService.query("/common/crm/customer/saveCustomer",requestParams);
			},
			sexlist : function(requestParams){
				return CommonRestService.query("/common/crm/customer/sexlist");
			},
			typelist:function(requestParams){
				if(requestParams==true){
					requestParams={}
				  }
				requestParams.customerParentType = 1;
				return CommonRestService.query("/common/crm/customer/typelist",requestParams);
			},
			levellist:function(requestParams){
				if(requestParams==true){
					requestParams={}
				  }
				requestParams.customerParentType = 1;
				return CommonRestService.query("/common/crm/customer/levellist",requestParams);
			},
			findCustomerPayInfo:function(requestParams){
				return CommonRestService.query("/common/crm/customer/findCustomerPayInfo",requestParams, false);
			},
			findCustomerPointRule:function(requestParams){
				return CommonRestService.query("/common/crm/customer/findCustomerPointRule",requestParams, false);
			},
			validatePayPassword :function(requestParams){
				return CommonRestService.query("/common/crm/customer/validatePayPassword",requestParams, false);
			},
			
			//-------------------------------------【会员结束】--------------------------------------
			
			//CartSaleCommonService
			//支付类型
			getOrderPayType:function(params){
				return CommonRestService.query("/rest/commonCart/order/getOrderPayType",params);
			},
			//查询出票类型
			getTicketType:function(params){
				return CommonRestService.query("/rest/commonCart/order/getTicketType",params);
			},
			//根据场次查询票面
			getEventTicketFaceListByEventId:function(requestParams){
				return CommonRestService.query("/rest/commonCart/order/getEventTicketFaceListByEventId",requestParams);
			},
			
			//查询商品套票优惠
			queryGoodDiscount : function(requestParams){
                return CommonRestService.query("/rest/commonCart/goods/getGoodsDiscount",requestParams,false);
            },
			
			//根据会员查询优惠
			findUserDiscount:function(requestParams){
				return CommonRestService.query("/rest/commonCart/order/findUserDiscount",requestParams);
			},
//			//创建订单
//			createOrder : function(requestParams){
//				console.log(requestParams);
//                return CommonRestService.query("/rest/commonCart/order/createOrder",requestParams,false);
//            },
			  //支付订单
			printOrder : function(requestParams) {
				return CommonRestService.query("/rest/commonCart/order/printOrder",requestParams);
			},
			//查询优惠折扣
			findOrderEventDiscount:function(requestParams){
				return CommonRestService.query("/rest/commonCart/order/findOrderEventDiscount",requestParams);
			},
			//查询订单优惠列表  3.0
			findOrderDiscountList:function(requestParams){
				return CommonRestService.query("/rest/commonCart/order/findOrderDiscountList",requestParams);
			},

			/**
			 * 统一下单接口
			 * 吕鹏开发 2016年7月1日
			 */
			createOrder:function(requestParams){
				return CommonRestService.query("/sale/order/createOrder",requestParams,false);
			},
			//获取购物车内的所有商品：
			getGoodsInShopingCart : function(requestParams){
				return CommonRestService.query("/rest/commonCart/order/getGoodsInShopingCart",requestParams, false);
			},

			//将商品存入购物车
			setGoodsToShopingCart :function(requestParams){
				return CommonRestService.query("/rest/commonCart/order/setGoodsToShopingCart",requestParams, false);
			},

			//清空购物车
			clearShopingCart : function(requestParams){
				return CommonRestService.query("/rest/commonCart/order/clearShopingCart",requestParams, false);
			}
		};
	});
	
	
	
	
	
	
	
	
	
	
	
});